package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface Setmeal_dishMapper {
    @Insert("insert into setmeal_dish values (#{id},#{setmealId},#{dishId},#{name},#{price},#{copies})")
    void add(SetmealDish et);
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> getlistBysetmeal_id(Long id);
    @Select("select dish_id from setmeal_dish where setmeal_id = #{Id} ")
    List<Long> getdishidByid(Long Id);
    @Delete("delete from setmeal_dish where setmeal_id = #{id}")
    void delete(Long id);
    void deletes(String[] ids);//批量删除,其实可以和上面合并
    @Select("select id from setmeal_dish where dish_id = #{id}")
    Integer getnameBydishid(Long id);
}
